package com.meisupic.copyright.util;

import com.meisupic.copyright.service.ISysDicService;
import java.util.Map;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * creation wuxun
 * @version V1.0
 * @Description: 字典类工具
 * @date 2018/1/14 16:22
 */
@Component
public class DictionaryUtil {


    private static ISysDicService staticSysDicService;

    @Autowired
    private ISysDicService sysDicService;

    @PostConstruct
    public void init() {
        DictionaryUtil.staticSysDicService = this.sysDicService;
    }

    public static String getDicNameByValue(String dicValue, String dicType) {
        Map<String, String> dicMap = staticSysDicService.findAllDic(dicType);
        return dicMap.get(dicValue);
    }
}
